package cn.net.msg.cxf.webservice.impl;

import java.io.IOException;

import javax.annotation.Resource;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;

import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;

import cn.net.msg.cxf.webservice.IFeedBackWebService;
import cn.net.msg.model.TbFeedBack;
import cn.net.msg.service.TbFeedBackService;

/**
 * <p>
 * FileName: FeedBackWebServiceImpl.java
 * </p>
 * <p>
 * Description: FeedBack的cxf服务实现类
 * <p>
 * Copyright: surepassserver(c) 2012
 * </p>
 * <p>
 * @author Vic Su
 * </p>
 * <p>
 * @content andyliu900@gmail.com
 * </p>
 * <p>
 * @version 1.0
 * </p>
 * <p>
 * CreatDate: 2012-11-8 下午11:25:06
 * </p>
 * <p>
 * Modification History
 */

@WebService
@SOAPBinding(style = Style.RPC)
@SuppressWarnings("deprecation")
public class FeedBackWebServiceImpl implements IFeedBackWebService {

    private static final long serialVersionUID = -7574227471498721534L;

    @Resource(name="tbFeedBackService")
    TbFeedBackService service;

    @Override
    public void sendFeedBackInfo(String feedBackJSONObject) {
        // TODO Auto-generated method stub
        try {
            ObjectMapper objectMapper = new ObjectMapper();
            TbFeedBack tbFeedBack = objectMapper.readValue(feedBackJSONObject, TbFeedBack.class);
            service.save(tbFeedBack);
        } catch (JsonParseException e) {
            e.printStackTrace();
        } catch (JsonMappingException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }  
    }
}
